
GNU gdb (Debian 8.2.1-2+b3) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /media/Environ/Compile/rocksndiamonds-4.1.4.1/rocksndiamonds...done.
(gdb) r
Starting program: /media/Environ/Compile/rocksndiamonds-4.1.4.1/rocksndiamonds 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe37ec700 (LWP 16907)]
[New Thread 0x7fffe37ab700 (LWP 16908)]
[New Thread 0x7fffe1905700 (LWP 16912)]
free(): double free detected in tcache 2

Thread 1 "rocksndiamonds" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff78a2535 in __GI_abort () at abort.c:79
#2  0x00007ffff78f9508 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7a0428d "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff78ffc1a in malloc_printerr (str=str@entry=0x7ffff7a05f58 "free(): double free detected in tcache 2") at malloc.c:5341
#4  0x00007ffff79016fd in _int_free (av=0x7ffff7a3bc40 <main_arena>, p=0x55555b36e6d0, have_lock=<optimized out>) at malloc.c:4193
#5  0x0000555555713b28 in checked_free (ptr=0x55555b36e6e0) at misc.c:1275
#6  0x0000555555712b25 in setString (old_value=0x55555860c330 <tape+16>, new_value=0x55555c785fe0 "rnd_david_hutchinson") at misc.c:844
#7  0x00005555556eca43 in TapeErase () at tape.c:530
#8  0x00005555556ecbff in TapeStartRecording (random_seed=1594876998) at tape.c:584
#9  0x00005555556a7c7b in StartGameActions (init_network_game=0, record_tape=1, random_seed=0) at game.c:11322
#10 0x00005555556648c0 in HandleMainMenu (mx=0, my=0, dx=0, dy=0, button=0) at screens.c:2134
#11 0x000055555564a6a5 in HandleKey (key=13, key_status=1) at events.c:2304
#12 0x0000555555648c63 in HandleKeyEvent (event=0x7fffffffd990) at events.c:1462
#13 0x0000555555646b84 in HandleEvents () at events.c:249
#14 0x0000555555646d67 in EventLoop () at events.c:348
#15 0x000055555563a1ca in main (argc=1, argv=0x7fffffffdae8) at main.c:7762
(gdb) # Just pressed ESC, froze on main menu
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /media/Environ/Compile/rocksndiamonds-4.1.4.1/rocksndiamonds 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe37ec700 (LWP 18952)]
[New Thread 0x7fffe37ab700 (LWP 18953)]
[New Thread 0x7fffe1905700 (LWP 18956)]
rocksndiamonds: frame delay == 40 ms (max. 25 fps / 50 %)
rocksndiamonds: frame delay == 60 ms (max. 16 fps / 33 %)
rocksndiamonds: frame delay == 125 ms (max. 8 fps / 16 %)
rocksndiamonds: frame delay == 0 ms (maximum speed)
rocksndiamonds: frame delay == 40 ms (max. 25 fps / 50 %)
rocksndiamonds: frame delay == 60 ms (max. 16 fps / 33 %)
rocksndiamonds: frame delay == 10 ms (max. 100 fps / 200 %)
rocksndiamonds: frame delay == 30 ms (max. 33 fps / 66 %)
free(): double free detected in tcache 2

Thread 1 "rocksndiamonds" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff78a2535 in __GI_abort () at abort.c:79
#2  0x00007ffff78f9508 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7a0428d "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff78ffc1a in malloc_printerr (str=str@entry=0x7ffff7a05f58 "free(): double free detected in tcache 2") at malloc.c:5341
#4  0x00007ffff79016fd in _int_free (av=0x7ffff7a3bc40 <main_arena>, p=0x55555b391140, have_lock=<optimized out>) at malloc.c:4193
#5  0x0000555555713b28 in checked_free (ptr=0x55555b391150) at misc.c:1275
#6  0x0000555555712b25 in setString (old_value=0x55555860c330 <tape+16>, new_value=0x55555c784de0 "rnd_david_hutchinson") at misc.c:844
#7  0x00005555556eca43 in TapeErase () at tape.c:530
#8  0x00005555556ecbff in TapeStartRecording (random_seed=1594640334) at tape.c:584
#9  0x00005555556a7c7b in StartGameActions (init_network_game=0, record_tape=1, random_seed=0) at game.c:11322
#10 0x00005555556648c0 in HandleMainMenu (mx=0, my=0, dx=0, dy=0, button=0) at screens.c:2134
#11 0x000055555564a6a5 in HandleKey (key=13, key_status=1) at events.c:2304
#12 0x0000555555648c63 in HandleKeyEvent (event=0x7fffffffd990) at events.c:1462
#13 0x0000555555646b84 in HandleEvents () at events.c:249
#14 0x0000555555646d67 in EventLoop () at events.c:348
#15 0x000055555563a1ca in main (argc=1, argv=0x7fffffffdae8) at main.c:7762
(gdb) # seems that pressing ESC to go back to main menu is a major cause of these crashes
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /media/Environ/Compile/rocksndiamonds-4.1.4.1/rocksndiamonds 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe37ec700 (LWP 22218)]
[New Thread 0x7fffe37ab700 (LWP 22219)]
[New Thread 0x7fffe1905700 (LWP 22220)]
rocksndiamonds: frame delay == 40 ms (max. 25 fps / 50 %)
rocksndiamonds: frame delay == 0 ms (maximum speed)
rocksndiamonds: frame delay == 40 ms (max. 25 fps / 50 %)
rocksndiamonds: frame delay == 60 ms (max. 16 fps / 33 %)
malloc_consolidate(): invalid chunk size

Thread 1 "rocksndiamonds" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff78a2535 in __GI_abort () at abort.c:79
#2  0x00007ffff78f9508 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7a0428d "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff78ffc1a in malloc_printerr (str=str@entry=0x7ffff7a05b68 "malloc_consolidate(): invalid chunk size") at malloc.c:5341
#4  0x00007ffff78fff2a in malloc_consolidate (av=av@entry=0x7ffff7a3bc40 <main_arena>) at malloc.c:4471
#5  0x00007ffff790179a in _int_free (av=0x7ffff7a3bc40 <main_arena>, p=0x55555b6f50d0, have_lock=<optimized out>) at malloc.c:4392
#6  0x00005555556ff04d in FreeGadget (gi=0x55555b703ae0) at gadgets.c:1451
#7  0x00005555556bd5c0 in FreeLevelEditorGadgets () at editor.c:7186
#8  0x000055555563a4aa in FreeGadgets () at init.c:155
#9  0x000055555563a4d4 in InitGadgets () at init.c:167
#10 0x000055555565f55d in ChangeViewportPropertiesIfNeeded () at tools.c:9723
#11 0x0000555555683d2f in InitGame () at game.c:3376
#12 0x00005555556a7c92 in StartGameActions (init_network_game=0, record_tape=1, random_seed=0) at game.c:11332
#13 0x00005555556648c0 in HandleMainMenu (mx=880, my=504, dx=0, dy=0, button=0) at screens.c:2134
#14 0x000055555564930b in HandleButton (mx=880, my=504, button=0, button_nr=1) at events.c:1723
#15 0x00005555556470fb in HandleButtonEvent (event=0x7fffffffd990) at events.c:518
#16 0x0000555555646b22 in HandleEvents () at events.c:215
#17 0x0000555555646d67 in EventLoop () at events.c:348
#18 0x000055555563a1ca in main (argc=1, argv=0x7fffffffdae8) at main.c:7762
(gdb) # In main menu tried to start a level recently played
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /media/Environ/Compile/rocksndiamonds-4.1.4.1/rocksndiamonds 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe37ec700 (LWP 343)]
[New Thread 0x7fffe37ab700 (LWP 344)]
[New Thread 0x7fffe1905700 (LWP 348)]
rocksndiamonds: frame delay == 30 ms (max. 33 fps / 66 %)
rocksndiamonds: frame delay == 20 ms (max. 50 fps / 100 %)
rocksndiamonds: warning: getKeyFromKeyName(): not completely implemented
free(): double free detected in tcache 2

Thread 1 "rocksndiamonds" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff78a2535 in __GI_abort () at abort.c:79
#2  0x00007ffff78f9508 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7a0428d "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff78ffc1a in malloc_printerr (str=str@entry=0x7ffff7a05f58 "free(): double free detected in tcache 2") at malloc.c:5341
#4  0x00007ffff79016fd in _int_free (av=0x7ffff7a3bc40 <main_arena>, p=0x55555b36b340, have_lock=<optimized out>) at malloc.c:4193
#5  0x0000555555713b28 in checked_free (ptr=0x55555b36b350) at misc.c:1275
#6  0x0000555555712b25 in setString (old_value=0x55555869c380 <levelset+4000>, new_value=0x55555c785a90 "rnd_david_hutchinson") at misc.c:844
#7  0x000055555565eb0e in SetLevelSetInfo (identifier=0x55555c785a90 "rnd_david_hutchinson", level_nr=24) at tools.c:9455
#8  0x00005555556e02bb in LoadLevel (nr=24) at files.c:6687
#9  0x0000555555662950 in DrawMainMenu () at screens.c:1624
#10 0x00005555556b31ab in RequestQuitGameExt (skip_request=1, quick_quit=1, message=0x5555557c9d60 "Do you really want to quit the game?") at game.c:15028
#11 0x00005555556b3252 in RequestQuitGame (ask_if_really_quit=0) at game.c:15048
#12 0x000055555564ab24 in HandleKey (key=27, key_status=1) at events.c:2376
#13 0x0000555555648c63 in HandleKeyEvent (event=0x7fffffffd990) at events.c:1462
#14 0x0000555555646b84 in HandleEvents () at events.c:249
#15 0x0000555555646d67 in EventLoop () at events.c:348
#16 0x000055555563a1ca in main (argc=1, argv=0x7fffffffdae8) at main.c:7762
(gdb) # just loaded the level then ESC or was it load last tape save?
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /media/Environ/Compile/rocksndiamonds-4.1.4.1/rocksndiamonds 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe37ec700 (LWP 5200)]
[New Thread 0x7fffe37ab700 (LWP 5201)]
[New Thread 0x7fffe1905700 (LWP 5202)]
rocksndiamonds: frame delay == 60 ms (max. 16 fps / 33 %)
rocksndiamonds: frame delay == 0 ms (maximum speed)
rocksndiamonds: frame delay == 40 ms (max. 25 fps / 50 %)
rocksndiamonds: frame delay == 60 ms (max. 16 fps / 33 %)
rocksndiamonds: frame delay == 60 ms (max. 16 fps / 33 %)
rocksndiamonds: frame delay == 0 ms (maximum speed)
rocksndiamonds: frame delay == 10 ms (max. 100 fps / 200 %)
rocksndiamonds: frame delay == 40 ms (max. 25 fps / 50 %)
rocksndiamonds: frame delay == 60 ms (max. 16 fps / 33 %)
rocksndiamonds: frame delay == 125 ms (max. 8 fps / 16 %)
[Thread 0x7fffe37ab700 (LWP 5201) exited]
[Thread 0x7fffe37ec700 (LWP 5200) exited]
[Thread 0x7fffe1905700 (LWP 5202) exited]
[Inferior 1 (process 5197) exited normally]
(gdb) r
Starting program: /media/Environ/Compile/rocksndiamonds-4.1.4.1/rocksndiamonds 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe37ec700 (LWP 11081)]
[New Thread 0x7fffe37ab700 (LWP 11082)]
[New Thread 0x7fffe1905700 (LWP 11086)]
[Thread 0x7fffe37ab700 (LWP 11082) exited]
[Thread 0x7fffe37ec700 (LWP 11081) exited]
[Thread 0x7fffe1905700 (LWP 11086) exited]
[Inferior 1 (process 11078) exited normally]
(gdb) r
Starting program: /media/Environ/Compile/rocksndiamonds-4.1.4.1/rocksndiamonds 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe37ec700 (LWP 11151)]
[New Thread 0x7fffe37ab700 (LWP 11152)]
[New Thread 0x7fffe1905700 (LWP 11154)]
[Thread 0x7fffe37ab700 (LWP 11152) exited]
[Thread 0x7fffe37ec700 (LWP 11151) exited]
[Thread 0x7fffe1905700 (LWP 11154) exited]
[Inferior 1 (process 11148) exited normally]
(gdb) r
Starting program: /media/Environ/Compile/rocksndiamonds-4.1.4.1/rocksndiamonds 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe37ec700 (LWP 12138)]
[New Thread 0x7fffe37ab700 (LWP 12139)]
[New Thread 0x7fffe1905700 (LWP 12142)]
rocksndiamonds: warning: getKeyFromKeyName(): not completely implemented
rocksndiamonds: warning: getKeyFromKeyName(): not completely implemented
rocksndiamonds: warning: getKeyFromKeyName(): not completely implemented

Thread 1 "rocksndiamonds" received signal SIGFPE, Arithmetic exception.
0x00005555556ac071 in ScrollScreen (player=0x0, mode=1) at game.c:12851
12851	    ScreenGfxPos = ScrollStepSize * (ScreenMovPos / ScrollStepSize);
(gdb) bt
#0  0x00005555556ac071 in ScrollScreen (player=0x0, mode=1) at game.c:12851
#1  0x00005555556a8958 in GameActions_RND () at game.c:11756
#2  0x00005555556a865c in GameActions_RND_Main () at game.c:11671
#3  0x00005555556a8367 in GameActionsExt () at game.c:11577
#4  0x00005555556a8485 in GameActions () at game.c:11625
#5  0x000055555567c8b9 in HandleGameActions () at screens.c:8369
#6  0x0000555555646d83 in EventLoop () at events.c:359
#7  0x000055555563a1ca in main (argc=1, argv=0x7fffffffdae8) at main.c:7762
(gdb) # When restoring level, character couldn't move even though there was space to. It would let me press ESC go back to main menu and try again. But every time, character couldn't move. After several times it crashed with the backtrace above.
(gdb) # Level 59 of CONTRIBUTIONS > CONTRIBUTIONS 2002 > JEROME KUNEGIS, A level I never beat
(gdb) q
A debugging session is active.

	Inferior 1 [process 12135] will be killed.

Quit anyway? (y or n) y

